import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import index from '../views/index/index'
import detail from '../views/index/detail'
import flex from '../views/index/flex'
import flex2 from '../views/index/flex2'
import flex3 from '../views/index/flex3'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/flex2"
  },
  {
    path: '/detail',
    name: 'detail',
    component: detail
  },
  {
    path: '/flex2',
    name: 'flex2',
    component: flex2
  },
  {
    path: '/flex3',
    name: 'flex3',
    component: flex3
  },
  {
    path: '/flex',
    name: 'flex',
    component: flex
  },
  {
    path: '/index',
    name: 'index',
    component: index
  },
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
